package cn.darksoul3.spark.als;

import lombok.Data;

import java.io.Serializable;

@Data
public class RatingData implements Serializable {

    private Integer userId;
    private Integer shopId;
    private Integer rating;

    public RatingData() {
    }

    public RatingData(Integer userId, Integer shopId, Integer rating) {
        this.userId = userId;
        this.shopId = shopId;
        this.rating = rating;
    }

    public static RatingData parseRating(String str){
        String[] array = str.replaceAll("\"","").split(",");
        return new RatingData(Integer.parseInt(array[0]),Integer.parseInt(array[1]),Integer.parseInt(array[2]));
    }


}